#define ROMFS_PATH_MAX NAME_MAX

struct romfs_file_node {
	/**
	 * 引用计数
	 */
	struct accurate_counter ref_count;
	/**
	 * 文件节点基本信息
	 */
	umode_t mode;
	size_t file_size;
	struct timespec access_time;
	struct timespec data_modify_time;
	struct timespec meta_modify_time;
	unsigned int node_num;
	uid_t uid;
	gid_t gid;
	/**
	 * 指向VFS层文件节点缓存
	 */
	struct filenode_cache *fnode_cache;
	bool may_delete;
	/**
	 * 文件节点在cpio文件系统中的路径
	 */
	char *rel_path;
	void *priv;
	unsigned short name_len;
	char name[0];
};

#define MODE_DIR (S_IFDIR | S_IRUGO | S_IXUGO)

struct cpio_newc_header {
	char c_magic[6];
	char c_ino[8];
	char c_mode[8];
	char c_uid[8];
	char c_gid[8];
	char c_nlink[8];
	char c_mtime[8];
	char c_filesize[8];
	char c_devmajor[8];
	char c_devminor[8];
	char c_rdevmajor[8];
	char c_rdevminor[8];
	char c_namesize[8];
	char c_check[8];
} __attribute__((packed));

#define CPIO_BLK_SIZE 512
#define CPIO_BLK_SIZE_ORDER 9 // 1 << 9 = 512
